package com.eshop.modules.activity.rest;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import io.swagger.annotations.ApiOperation;
import com.eshop.logging.aop.log.Log;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.data.domain.Pageable;
import com.eshop.modules.activity.service.dto.StorePinkQueryCriteria;
import com.eshop.modules.activity.service.StorePinkService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;

@Api(tags = { "商城:拼团记录管理" })
@RestController
@RequestMapping({ "api" })
public class StorePinkController
{
    private final StorePinkService storePinkService;
    
    public StorePinkController(final StorePinkService storePinkService) {
        this.storePinkService = storePinkService;
    }
    
    @Log("查询记录")
    @ApiOperation("查询记录")
    @GetMapping({ "/yxStorePink" })
    @PreAuthorize("@el.check('admin','YXSTOREPINK_ALL','YXSTOREPINK_SELECT')")
    public ResponseEntity getYxStorePinks(final StorePinkQueryCriteria criteria, final Pageable pageable) {
        return new ResponseEntity(this.storePinkService.queryAll(criteria, pageable), HttpStatus.OK);
    }
}
